/*============================================================================*/
/*                                                                            */
/*  FILE       : fpf.h (Filter Parameter File)                                */
/*  CONTENTS   : Contains support functions for Filter Parameter Files        */
/*----------------------------------------------------------------------------*/
/*    $Archive:: /Software/mbapi/release/include/fileio/FPF.H                $*/
/*   $Revision:: 217                                                         $*/
/*----------------------------------------------------------------------------*/
/*  VISIBILITY : Public                                                       */
/*               Copyright (c) 1997 Motionbase PLC                            */
/*               All rights reserved.                                         */
/*----------------------------------------------------------------------------*/
/*  HISTORY    :                                                              */
/*                                                                            */
/*    Date     Author    Description                                          */
/*  05/12/97     KG      Created                                              */
/*  19/05/99     KG      Added CCONV modifier to export functions from DLL.   */
/*============================================================================*/
#ifndef _FPF_H_
#define _FPF_H_

#ifdef __cplusplus
extern "C" {
#endif

/*============================================================================*/
/* INCLUDES                                                                   */
/*============================================================================*/
#include "filters.h"                   /* cnNUMBER_OF_FILTER_BLOCKS, ...      */

/*============================================================================*/
/* TYPEDEFS                                                                   */
/*============================================================================*/
/*----------------------------------------------------------------------------*/
/* Enumerate error codes from this module                                     */
/*----------------------------------------------------------------------------*/
typedef enum {
  fpfSUCCESS = 0,
  fpfUNABLE_TO_OPEN_FILE,
  fpfBAD_FILE_FORMAT,
  fpfBAD_FORMAT_VERSION,
  fpfNULL_POINTER,
  fpfLAST_ERROR
} TFPFError;

/*----------------------------------------------------------------------------*/
/* Define a structure to hold a group of continuous-time filter blocks.       */
/*----------------------------------------------------------------------------*/
typedef struct {
  /*--------------------------------------------------------------------------*/
  /* Flag that indicates whether the motion cueing algorithms are enabled.    */
  /*--------------------------------------------------------------------------*/
  UINT motionCueingOn;
  /*--------------------------------------------------------------------------*/
  /* Flag that indicates whether the translational acceleratins are given     */
  /* as specific forces (i.e. whether they include the acceleration due to    */
  /* gravity).                                                                */
  /*--------------------------------------------------------------------------*/
  UINT specificForcesOn;
  /*--------------------------------------------------------------------------*/
  /* Flag that indicates whether adaption is enabled.                         */
  /*--------------------------------------------------------------------------*/
  UINT adaptionOn;
  /*--------------------------------------------------------------------------*/
  /* A collection of filter blocks.                                           */
  /*--------------------------------------------------------------------------*/
  TContinuousTimeFilterBlock filterBlock[cnNUMBER_OF_FILTER_BLOCKS];
} TFilterGroup;

/*============================================================================*/
/* FUNCTION PROTOTYPES                                                        */
/*============================================================================*/
/*----------------------------------------------------------------------------*/
/* readFilterParameterFile                                                    */
/* Reads the contents of a Filter Parameter File into provided data structure.*/
/*                                                                            */
/* Args:                                                                      */
/* filePath        - full path to the Filter Parameter File                   */
/* expectedVersion - the file format version that this module expects to see  */
/* pFilterGroup    - pointer to Filter Parameter structure where data should  */
/*                   be stored                                                */
/* Return:                                                                    */
/* fpfXXX enumeration                                                         */
/*----------------------------------------------------------------------------*/
CCONV TFPFError readFilterParameterFile (CHAR* filePath,
                                         INT* expectedVersion,
                                         TFilterGroup* pFilterGroup);

/*----------------------------------------------------------------------------*/
/* fpfErrorMessage                                                            */
/* Returns an error message associated with a module error code               */
/*                                                                            */
/* Args:                                                                      */
/* error - the error code for which a message is required.                    */
/*                                                                            */
/* Return:                                                                    */
/* Pointer to a message string.                                               */
/*----------------------------------------------------------------------------*/
CCONV const CHAR* fpfErrorMessage (TFPFError error);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* _FPF_H_ */
/*============================================================================*/
/* END OF FILE                                                                */
/*============================================================================*/
